<!-- HTML header for doxygen 1.9.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>COMMONS-NET: commonsNet.smtp.SimpleSMTPHeader类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">COMMONS-NET
   </div>
  </td>
    <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('classcommonsNet_1_1smtp_1_1SimpleSMTPHeader.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pri-attribs">Private 属性</a> &#124;
<a href="classcommonsNet_1_1smtp_1_1SimpleSMTPHeader-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">commonsNet.smtp.SimpleSMTPHeader类 参考</div></div>
</div><!--header-->
<div class="contents">

<p>此类用于构造电子邮件消息的最低可接受标头。要构造更复杂的标头，您应该参考RFC 5322。  
 <a href="classcommonsNet_1_1smtp_1_1SimpleSMTPHeader.html#details">更多...</a></p>
<div class="dynheader">
类 commonsNet.smtp.SimpleSMTPHeader 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classcommonsNet_1_1smtp_1_1SimpleSMTPHeader.png" alt=""/>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a3f9dbcd3ca60b375edc960a902069fd3"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1smtp_1_1SimpleSMTPHeader.html#a3f9dbcd3ca60b375edc960a902069fd3">addHeaderField</a> (headerField: String, value: String)</td></tr>
<tr class="memdesc:a3f9dbcd3ca60b375edc960a902069fd3"><td class="mdescLeft">&#160;</td><td class="mdescRight">将具有给定值的任意标头字段添加到标头中。当SimpleSMTPHeader转换为字符串时，这些标头将写在From、To、Subject和Cc字段之前。示例用法如下：  <br /></td></tr>
<tr class="separator:a3f9dbcd3ca60b375edc960a902069fd3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a94ec47796459a00645627e4608100bc3"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1smtp_1_1SimpleSMTPHeader.html#a94ec47796459a00645627e4608100bc3">addCC</a> (address: String)</td></tr>
<tr class="memdesc:a94ec47796459a00645627e4608100bc3"><td class="mdescLeft">&#160;</td><td class="mdescRight">在CC（抄送）列表中添加电子邮件地址。  <br /></td></tr>
<tr class="separator:a94ec47796459a00645627e4608100bc3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af21f259acc4390cd13fce722522f04aa"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1smtp_1_1SimpleSMTPHeader.html#af21f259acc4390cd13fce722522f04aa">toString</a> (): String</td></tr>
<tr class="memdesc:af21f259acc4390cd13fce722522f04aa"><td class="mdescLeft">&#160;</td><td class="mdescRight">将SimpleSMTPHeader转换为字符串形式的格式正确的标头，包括用于将标题与文章正文分隔开的空行。字段CC和Subject仅在非空时才包括在内。  <br /></td></tr>
<tr class="separator:af21f259acc4390cd13fce722522f04aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-attribs" name="pri-attribs"></a>
Private 属性</h2></td></tr>
<tr class="memitem:a2ab092dd389836b7155b6b5b8455ce56"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1smtp_1_1SimpleSMTPHeader.html#a2ab092dd389836b7155b6b5b8455ce56">let `from`</a> : String</td></tr>
<tr class="separator:a2ab092dd389836b7155b6b5b8455ce56"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a174d687524907cb6f9b78441f181f095"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1smtp_1_1SimpleSMTPHeader.html#a174d687524907cb6f9b78441f181f095">let subject</a> : ?String</td></tr>
<tr class="separator:a174d687524907cb6f9b78441f181f095"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0269b7f3eaf5bf089b5d9a7843361ce0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1smtp_1_1SimpleSMTPHeader.html#a0269b7f3eaf5bf089b5d9a7843361ce0">let to</a> : ?String</td></tr>
<tr class="separator:a0269b7f3eaf5bf089b5d9a7843361ce0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a65e0132fd4effea80aabf5c281825e73"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1smtp_1_1SimpleSMTPHeader.html#a65e0132fd4effea80aabf5c281825e73">let headerFields</a> : StringBuilder</td></tr>
<tr class="separator:a65e0132fd4effea80aabf5c281825e73"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0537b9390f915ffe9c24e9114eb2e06e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1smtp_1_1SimpleSMTPHeader.html#a0537b9390f915ffe9c24e9114eb2e06e">var hasHeaderDate</a> : Bool</td></tr>
<tr class="separator:a0537b9390f915ffe9c24e9114eb2e06e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad403f9326cd5a1d8ac4231e3e5697c75"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1smtp_1_1SimpleSMTPHeader.html#ad403f9326cd5a1d8ac4231e3e5697c75">var cc</a> : ?StringBuilder</td></tr>
<tr class="separator:ad403f9326cd5a1d8ac4231e3e5697c75"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>此类用于构造电子邮件消息的最低可接受标头。要构造更复杂的标头，您应该参考RFC 5322。 </p>
<p>该类的主要目的是简化邮件发送过程，使程序员无需显式格式化简单的消息头。例如：<br  />
 </p><pre>
 let writer = client.sendMessageData()
 if (writer == None) // failure
   return false
 header =
     SimpleSMTPHeader("foobar@foo.com", "foo@bar.com" "Just testing")
 header.addCC("bar@foo.com")
 header.addHeaderField("Organization", "Foobar, Inc.")
 writer.write(header.toString())
 writer.write("This is just a test")
 writer.close()
 if (!client.completePendingCommand()) // failure
   return false
 </pre><dl class="section see"><dt>参见</dt><dd>SMTPClient </dd></dl>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="a94ec47796459a00645627e4608100bc3" name="a94ec47796459a00645627e4608100bc3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a94ec47796459a00645627e4608100bc3">&#9670;&#160;</a></span>addCC()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.smtp.SimpleSMTPHeader.addCC </td>
          <td>(</td>
          <td class="paramname"><em>address</em>:&#160;</td>
          <td class="paramtype">String</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>在CC（抄送）列表中添加电子邮件地址。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">address</td><td>要添加到CC列表的电子邮件地址。 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a3f9dbcd3ca60b375edc960a902069fd3" name="a3f9dbcd3ca60b375edc960a902069fd3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3f9dbcd3ca60b375edc960a902069fd3">&#9670;&#160;</a></span>addHeaderField()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.smtp.SimpleSMTPHeader.addHeaderField </td>
          <td>(</td>
          <td class="paramname"><em>headerField</em>:&#160;</td>
          <td class="paramtype">String, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>value</em>:&#160;</td>
          <td class="paramtype">String&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>将具有给定值的任意标头字段添加到标头中。当SimpleSMTPHeader转换为字符串时，这些标头将写在From、To、Subject和Cc字段之前。示例用法如下： </p>
<pre>
 header.addHeaderField("Organization", "Foobar, Inc.")
 </pre><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">headerField</td><td>要添加的标头字段，不包括冒号。 </td></tr>
    <tr><td class="paramname">value</td><td>添加的标头字段的值。 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="af21f259acc4390cd13fce722522f04aa" name="af21f259acc4390cd13fce722522f04aa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af21f259acc4390cd13fce722522f04aa">&#9670;&#160;</a></span>toString()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.smtp.SimpleSMTPHeader.toString </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: String </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>将SimpleSMTPHeader转换为字符串形式的格式正确的标头，包括用于将标题与文章正文分隔开的空行。字段CC和Subject仅在非空时才包括在内。 </p>
<dl class="section return"><dt>返回</dt><dd>字符串形式的消息头。 </dd></dl>

</div>
</div>
<h2 class="groupheader">类成员变量说明</h2>
<a id="a2ab092dd389836b7155b6b5b8455ce56" name="a2ab092dd389836b7155b6b5b8455ce56"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2ab092dd389836b7155b6b5b8455ce56">&#9670;&#160;</a></span>let `from`</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.smtp.SimpleSMTPHeader.let `from` : String</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a65e0132fd4effea80aabf5c281825e73" name="a65e0132fd4effea80aabf5c281825e73"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a65e0132fd4effea80aabf5c281825e73">&#9670;&#160;</a></span>let headerFields</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.smtp.SimpleSMTPHeader.let headerFields : StringBuilder</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a174d687524907cb6f9b78441f181f095" name="a174d687524907cb6f9b78441f181f095"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a174d687524907cb6f9b78441f181f095">&#9670;&#160;</a></span>let subject</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.smtp.SimpleSMTPHeader.let subject : ?String</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a0269b7f3eaf5bf089b5d9a7843361ce0" name="a0269b7f3eaf5bf089b5d9a7843361ce0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0269b7f3eaf5bf089b5d9a7843361ce0">&#9670;&#160;</a></span>let to</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.smtp.SimpleSMTPHeader.let to : ?String</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="ad403f9326cd5a1d8ac4231e3e5697c75" name="ad403f9326cd5a1d8ac4231e3e5697c75"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad403f9326cd5a1d8ac4231e3e5697c75">&#9670;&#160;</a></span>var cc</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.smtp.SimpleSMTPHeader.var cc : ?StringBuilder</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a0537b9390f915ffe9c24e9114eb2e06e" name="a0537b9390f915ffe9c24e9114eb2e06e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0537b9390f915ffe9c24e9114eb2e06e">&#9670;&#160;</a></span>var hasHeaderDate</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.smtp.SimpleSMTPHeader.var hasHeaderDate : Bool</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>src/smtp/<a class="el" href="simple__smtp__header_8cj.html">simple_smtp_header.cj</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.9.6-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespacecommonsNet.html">commonsNet</a></li><li class="navelem"><a class="el" href="namespacecommonsNet_1_1smtp.html">smtp</a></li><li class="navelem"><a class="el" href="classcommonsNet_1_1smtp_1_1SimpleSMTPHeader.html">SimpleSMTPHeader</a></li>
    <li class="footer">制作者 <img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
  </ul>
</div>
</body>
</html>
